/*
 * HTConverter.cpp
 *
 *  Created on: Mar 14, 2009
 *      Author: Andrzej Olchawa
 *      mailto: andrzejolchawa@gmail.com
 *      http://www.hardtechnology.org
 *      This is a part of the Armazd project, which is covered by
 *      GNU GPL v2 license.
 */

#include "HTConverter.h"

HTConverter::HTConverter() {}

HTConverter::~HTConverter() {}

string HTConverter::intToStr(int x)
{
	ostringstream output;
	if ( !(output << x) )
	{
		throw HTException("string AOFramework.AOConterver.intToStr(int): conversion error");
	}
    return output.str();
}

int HTConverter::strToInt(string str)
{
	stringstream input(str);
    int number;

    if ( !(input >> number) )
    {
		throw HTException("int AOFramework.AOConterver.strToInt(string): conversion error");
    }

    return number;
}
